
/**
\file Convenience wrapper functions for builtin C++ cast types.
\note These functions exist simply to enable auto-complete within Visual Studio. They have the side benefit of now being compatible with function objects.
\author Sean Tromans
*/

#ifndef	NMN_TEMPLATE_CASTS_HPP
#define	NMN_TEMPLATE_CASTS_HPP

namespace nmn
{

	/**
	Wrapper function around static_cast.
	@param val The value to be statically casted.
	*/
	template < typename TToType, typename TFromType >
	TToType static_cast_( TFromType const & val )
	{
		return static_cast< TToType >( val );
	}

	/**
	Wrapper function around dynamic_cast.
	@param val The value to be dynamically casted.
	*/
	template < typename TToType, typename TFromType >
	TToType dynamic_cast_( TFromType const & val )
	{
		return dynamic_cast< TToType >( val );
	}

#if 0	// Untested and I have never wished to use them.

	/**
	Wrapper function around const_cast.
	@param val The value to be const casted.
	*/
	template < typename TToType, typename TFromType >
	TToType const_cast_( TFromType const & val )
	{
		return const_cast< TToType >( val );
	}

	/**
	Wrapper function around reinterpret_cast.
	@param val The value to be reinterpretted.
	*/
	template < typename TToType, typename TFromType >
	TToType reinterpret_cast_( TFromType const & val )
	{
		return reinterpret_cast< TToType >( val );
	}

#endif

}

#endif	//NMN_TEMPLATE_CASTS_HPP
